package gui.panels.media;

import gui.panels.media.dnd.MediaDragGestureRecognizer;
import gui.panels.media.dnd.MediaDragSourceListener;

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Rectangle;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragGestureRecognizer;
import java.awt.dnd.DragSource;
import java.awt.dnd.DragSourceDragEvent;
import java.awt.dnd.DragSourceDropEvent;
import java.awt.dnd.DragSourceEvent;
import java.awt.dnd.DragSourceListener;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetListener;
import java.awt.event.InputEvent;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import javax.media.CannotRealizeException;
import javax.media.Manager;
import javax.media.NoPlayerException;
import javax.media.Player;
import javax.media.Time;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.border.BevelBorder;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

import media.process.MediaSliceContainer;
import java.awt.GridBagLayout;
import javax.swing.border.EtchedBorder;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.Color;

public class MediaPanel extends JPanel implements MediaContainer
{
	private JPanel pnlMediaVideo = null;
	/**
	 * This method initializes this
	 * 
	 */
	private void initialize() {
		
		setLayout( null ); // use a BorderLayout
		this.setBounds(new Rectangle(0, 0, 353, 270));
		this.add(getPnlMediaVideo(), null);
	}
	
	public MediaPanel(){


		initialize();
	}


	/**
	 * This method initializes pnlMediaVideo	
	 * 	
	 * @return javax.swing.JPanel	
	 */
	private JPanel getPnlMediaVideo() {
		if (pnlMediaVideo == null) {
			pnlMediaVideo = new PlayerGUIPanel();
			pnlMediaVideo.setBounds(new Rectangle(13, 13, 327, 245));
			
			



		}
		return pnlMediaVideo;
	}

	public static void main(String[] args){
		JFrame ventana = new JFrame();

		MediaPanel mp = new MediaPanel();
		ventana.getContentPane().add(mp);
		ventana.setSize(200, 200);
		ventana.setVisible(true);
	}

	@Override
	public Player getPlayer() {
		
		return ((PlayerGUIPanel)this.getPnlMediaVideo()).getPlayer();
	}

	@Override
	public void setStartTime(long time) {
		//this.getTxtStartVideo().setText(Long.toString(time));
		((MediaContainer)this.getPnlMediaVideo()).setStartTime(time);
	}

	@Override
	public void setStopTime(long time) {
		//this.getTxtEndVideo().setText(Long.toString(time));
		((MediaContainer)this.getPnlMediaVideo()).setStopTime(time);
		
	}

	


}  //  @jve:decl-index=0:visual-constraint="9,-1"// end class MediaPanel
